//
//  UIViewController+Extention.h
//  pmm
//
//  Created by WTFSSD on 2017/8/5.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import <UIKit/UIKit.h>
@import CoreTelephony;
@import AssetsLibrary;
@import AVFoundation;
@import Photos;

typedef void(^ClickCallBackHandle)(UIAlertAction* action,NSArray<UITextField*>*textFields);

@interface UIViewController (Extention)<UINavigationControllerDelegate,UIImagePickerControllerDelegate>


/**
 *  弹出UIAlertController 无输入框
 
 *  @param style UIAlertControllerStyle 样式
 *  @param title 标题
 *  @param message 消息
 *  @param options 按钮数组
 *  @param cancelIndex 退出按钮的下标
 *  @param destructiveIndex 着重按钮下标
 *  @param clickCallBack ClickCallBackHandle 点击回调
 *  @return UIViewController
 */
-(UIViewController*)showAlertWith:(UIAlertControllerStyle)style
                            title:(NSString*)title
                          message:(NSString*)message
                          options:(NSArray<NSString*>*)options
                      cancelIndex:(NSInteger)cancelIndex
                 destructiveIndex:(NSInteger)destructiveIndex
                    clickCallBack:(ClickCallBackHandle)clickCallBack;

/**
 *  弹出UIAlertController 可带输入框
 
 *  @param style UIAlertControllerStyle 样式
 *  @param title 标题
 *  @param message 消息
 *  @param options 按钮数组
 *  @param cancelIndex 退出按钮的下标
 *  @param destructiveIndex 着重按钮下标
 *  @param textFields 输入框个数
 *  @param textFeildConfig 输入框配置
 *  @param clickCallBack ClickCallBackHandle 点击回调
 *  @return UIViewController
 */
-(UIViewController*)showAlertWith:(UIAlertControllerStyle)style
                            title:(NSString*)title
                          message:(NSString*)message
                          options:(NSArray<NSString*>*)options
                      cancelIndex:(NSInteger)cancelIndex
                 destructiveIndex:(NSInteger)destructiveIndex
                       textFields:(NSInteger)textFields
                  textFeildConfig:(void(^)(UITextField * textField,NSInteger index))textFeildConfig
                    clickCallBack:(ClickCallBackHandle)clickCallBack;

/**
 *  弹出UIAlertController 提示选择照片 ActionSheet样式
 
 *  @param selectedImage void(^)(UIImage * selectedImage) 选中照片回调
 *  @return UIViewController
 */

-(UIViewController*)showImagePickerWith:(void(^)(UIImage * selectedImage))selectedImage;


/**
 *  弹出UIAlertController ActionSheet样式
 
 *  @param title 标题
 *  @param message 消息
 *  @param options 按钮数组
 *  @param clickCallBack ClickCallBackHandle 点击回调
 *  @return UIViewController
 */
-(UIViewController*)showActionSheetWith:(NSString*)title
                                message:(NSString*)message
                                options:(NSArray<NSString*>*)options
                          clickCallBack:(ClickCallBackHandle)clickCallBack;

/**
 *  弹出UIAlertController Alert样式
 
 *  @param title 标题
 *  @param message 消息
 *  @param options 按钮数组
 *  @param cancelIndex 退出按钮的下标
 *  @param destructiveIndex 着重按钮下标
 *  @param clickCallBack ClickCallBackHandle 点击回调
 *  @return UIViewController
 */
-(UIViewController*)showAlertWith:(NSString*)title
                          message:(NSString*)message
                          options:(NSArray<NSString*>*)options
                      cancelIndex:(NSInteger)cancelIndex
                 destructiveIndex:(NSInteger)destructiveIndex
                    clickCallBack:(ClickCallBackHandle)clickCallBack;

@end
